<template>
    <div class="header">
        <div class="header-c">
        <div class="h-logo"><img src="../assets/img/logo.svg" /> </div>
        <el-menu  class="el-menu-demo" :router="true" mode="horizontal">
            <el-menu-item v-if="!is_Login" index="/api">API设置</el-menu-item>
            <el-menu-item v-if="!is_Login" index="/control/ploy">策略中心</el-menu-item>
            <el-menu-item v-if="!is_Login" index="/treasure">套利宝</el-menu-item>
            <!--<el-menu-item index="1">处理中心</el-menu-item>-->
            <!--<el-submenu index="2">-->
                <!--<template slot="title">我的工作台</template>-->
                <!--<el-menu-item index="2-1">选项1</el-menu-item>-->
                <!--<el-menu-item index="2-2">选项2</el-menu-item>-->
                <!--<el-menu-item index="2-3">选项3</el-menu-item>-->
                <!--<el-submenu index="2-4">-->
                    <!--<template slot="title">选项4</template>-->
                    <!--<el-menu-item index="2-4-1">选项1</el-menu-item>-->
                    <!--<el-menu-item index="2-4-2">选项2</el-menu-item>-->
                    <!--<el-menu-item index="2-4-3">选项3</el-menu-item>-->
                <!--</el-submenu>-->
            <!--</el-submenu>-->
            <!--<el-menu-item index="3" disabled>消息中心</el-menu-item>-->
                <el-menu-item v-if="is_Login" index="/login">登录</el-menu-item>
                <el-menu-item v-if="is_Login" index="/regist">注册</el-menu-item>
                <el-submenu v-if="!is_Login" index="4">
                    <template slot="title">个人中心</template>
                    <el-menu-item index="4-1" @click="toMy()">个人中心</el-menu-item>
                    <el-menu-item index="4-2" @click="loginOut()">注销</el-menu-item>
                </el-submenu>
        </el-menu>
        </div>
    </div>
</template>

<script>
    export default {
        name: "Header",
        data(){
            return {
                is_Login:false
            }
        },
        mounted(){
            this.is_Login=!this.isLogin();
        },
        methods:{
            loginOut:function () {
                this.clearUserInfo();
            },
            toMember:function () {
                this.$router.push({name: 'ploy'});
            },
            toMy:function () {
                this.$router.push({name:'my'});
            }
        }
    }
</script>

<style scoped lang="scss">
.header{
    height: 60px; position: fixed; z-index: 1000; background: #fff;width: 100%;min-width: 1200px; border-bottom: 1px solid #E8E9EC;
    .header-c{
        width: 1200px; margin: 0 auto;
        .h-logo{ float: left; margin-top: 10px}
        .el-menu-demo{
            border: none; float: right;
        }
        .el-menu-item a{
            display: block;
        }
    }
}
</style>
